package org.water.common.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.water.base.entity.R;
import org.water.common.exception.SysCode;

@RestController
@RequestMapping("/shiro")
public class ShiroController {

	
	/**
	 * 未授权的访问
	 * @return
	 */
	@RequestMapping("/login")
	public R login()
	{
		return R.instance().setMsg("请登录");
	}
	/**
	 * 未授权的访问
	 * @return
	 */
	@RequestMapping("/unauthorized")
	public R unauthorized()
	{
		return R.instance().setCode(SysCode.unauthorized.getCode()).setMsg(SysCode.unauthorized.getMsg());
	}
	
	/**
	 * 授权成功
	 * @return
	 */
	@RequestMapping("/sucess")
	public R sucess()
	{
		return R.instance().setMsg("授权成功");
	}
	
	/**
	 * 授权成功
	 * @return
	 */
	@RequestMapping("/error")
	public R error()
	{
		return R.instance().setMsg("路径错误");
	}
	
}
